<?php

	include_once('../sys/sys.php');
	header('Content-Type: text/html; charset=utf-8');
	$action = $_GET['action'];
	$tid = $_GET['id'];
	
	if(!is_numeric($tid) || $tid < 0){
		show_normal_mesR('TAG ID错误','TAG ID错误','TAG查询');
	}
	//开始获取该ID下的图片
	$DB->build_query(array(
			'select' 	=> 'text,ispic',
			'from'		=> '520photos',
			'where'		=>	'pid=' . $tid,
	));
	$qid = $DB->exec_query();
	
	while ($row = $DB->fetch_row($qid)) {
		if ($row['ispic'] == 1) {
			
			$replacer = array('divalign','imgsrc','"alig','r"borde');
			$replacerc = array('div align','img src','" alig','r" borde');
			$text = str_replace($replacer,$replacerc,html_entity_decode($row['text']));
			
			echo '<html>' . $text . '</div></html>';
		}
		else
			echo nl2br($row['text']);
	}


	
?>